<?php
/**
 * File: cmsfiles.php.
 * Author: caoqicheng@haibao.com
 * Editor: PhpStorm
 * Date: 17/2/7 上午10:45
 * Brief:
 */
namespace haibao\jiepai\model\data\file;

class CmsFiles extends \haibao\jiepai\model\data\Base{
	
	/**
	 * 删除时置为-1，默认是0
	 * 是否是删除
	 */
	const FLAG_IS = 0;
	const FLAG_DEL = -1;

	/**
	 * 比例 1->2:3,2->1:1,3->3:2
	 */
	const RATIO_2_3 = 1;
	const RATIO_1_1 = 2;
	const RATIO_3_2 = 3;
	
	public $UserID;

	public $CreateTime;
	
	public $OriginalName;
	
	public $ServerFileName;
	
	public $ShareFileName;

	public $FileSize;
	
	public $FileWidth;
	
	public $FileHeight;
	
	public $CropX;
	
	public $CropY;
	
	public $CropWidth;
	
	public $CropHeight;
	
	public $Ratio;
	
	public $Duration;
	
	public $Flag;
	
	public $Description;
	
	public $FileType;
	
	public $CropStyle1;
	
	/**
	 * 图片前台显示url
	 */
	public $ShowUrl;
	
	
	public function __construct(){
		parent::__construct();
		$this->setColumnName('Id', 'FileID');
		
		$this->intField('UserID', 'UserID');
		$this->dateField('CreateTime', 'CreateTime',true);
		$this->stringField('OriginalName', 'OriginalName');
		$this->stringField('ServerFileName', 'ServerFileName');
		$this->stringField('ShareFileName', 'ShareFileName');
		$this->intField('FileSize', 'FileSize');
		$this->intField('FileWidth', 'FileWidth');
		$this->intField('FileHeight', 'FileHeight');
		$this->intField('CropX', 'CropX');
		$this->intField('CropY', 'CropY');
		$this->intField('CropWidth', 'CropWidth');
		$this->intField('CropHeight', 'CropHeight');
		$this->intField('Ratio', 'Ratio');
		$this->intField('Duration', 'Duration');
		$this->intField('Flag', 'Flag',true);
		$this->stringField('Description', 'Description');
		$this->stringField('FileType', 'FileType');
		$this->stringField('CropStyle1', 'CropStyle1');
		
		$this->setTableName('cms_files');
	}
}